package com.dodoke.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration  //标识配置文件
public class MybatisPlusConfig {

    /**
     * mp分页配置
     * @return
     */
    @Bean
    public MybatisPlusInterceptor  mybatisPlusInterceptor(){
        //创建拦截器
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //添加内部的分页拦截器
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}
